import { Injectable } from '@nestjs/common';
import { CreateApHwDto } from './dto/create-ap_hw.dto';
import { UpdateApHwDto } from './dto/update-ap_hw.dto';

@Injectable()
export class ApHwService {

  public apInfo = {
    cpu_usage: Math.floor(Math.random() * 301) - 100,
    memory_usage: Math.floor(Math.random() * 301) - 100,
    disk_usage: Math.floor(Math.random() * 301) - 100
  }

  private device_type:number[]= [0,1,2]

  setApInfo(){
    this.apInfo.cpu_usage = Math.floor(Math.random() * 301) - 100
    this.apInfo.memory_usage = Math.floor(Math.random() * 301) - 100
    this.apInfo.disk_usage = Math.floor(Math.random() * 301) - 100
    return this.apInfo
  }

    getApInfo() {
        return {
          code:200,
          data:this.setApInfo()
        }
    }

    getDeviceInfo() {
        return {
          code:200,
          data:{
            device_type:1,
          }
        }
    }
}